/*
** my_putnbr.c for minishell2 in /home/lingla_j/work/tutorat/env
** 
** Made by julien linglain
** Login   <lingla_j@epitech.net>
** 
** Started on  Tue Feb 28 22:54:55 2012 julien linglain
** Last update Tue Feb 28 23:03:05 2012 julien linglain
*/

#include "mysh.h"

int	my_putnbr(int nbr)
{
  int	begin;
  int	end;

  if (nbr < 0)
    {
      my_putchar('-');
      my_putnbr(-nbr);
    }
  else
    {
      end = nbr % 10;
      begin = nbr / 10;
      if (begin != 0)
	my_putnbr(begin);
      my_putchar(end + '0');
    }
  return (0);
}
